// wait_group 实现有条件的等待
#include <workflow/WFFacilities.h>
#include <workflow/WFTaskFactory.h>
#include <iostream>
#include <signal.h>
using std::cout;
using std::cerr;
static WFFacilities::WaitGroup waitGroup(1);
void handler(int signum){
    cout << "done\n";
    waitGroup.done();
}
int main(){
    signal(SIGINT,handler);
    // 用户代码 1 创建任务
    WFHttpTask * httpTask =  WFTaskFactory::create_http_task(
        //"http://www.baidu.com",
        "http://localhost/en/index.html",
        10,
        10,
        nullptr
    );
    // 用户代码 2 把任务交给框架
    httpTask->start();

    waitGroup.wait();
    cout << "finish!\n";
}
